package bll

import (
	"jgt-oper/src/model"
	"jgt-oper/src/schema"
)

// ResourceReserved 资源预定
type ResourceReserved struct {
	ResourceReservedMod model.IResourceReserved `inject:"IResourceReserved"`
}

// Create 创建预定
func (a *ResourceReserved) Create(item *schema.ResourceReserved) error {
	return a.ResourceReservedMod.Create(item)
}

// Get 查询指定预定信息
func (a *ResourceReserved) Get(recordID string) (*schema.ResourceReserved, error) {
	return a.ResourceReservedMod.Get(recordID)
}

// QueryItems 查询指定资源、指定日期的预约情况
func (a *ResourceReserved) QueryItems(resourceID, date string) ([]*schema.ResourceReserved, error) {
	return a.ResourceReservedMod.QueryItems(resourceID, date)
}

func (a *ResourceReserved) Update(recordID string, info map[string]interface{}) error {
	return a.ResourceReservedMod.Update(recordID, info)
}

func (a *ResourceReserved) QueryReservedPage(params *schema.ResourceReservedQParams) (int, []*schema.ResourceReserved, error) {
	return a.ResourceReservedMod.QueryReservedPage(params)
}
